<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__sysclk__pilo__funcs.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__sysclk.html">SysClk       (System Clock)</a> &raquo; <a class="el" href="group__group__sysclk__pilo.html">Precision Internal Low-Speed Oscillator (PILO)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga92e44b1390d7cabf2c597c45a5fdd309"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#ga92e44b1390d7cabf2c597c45a5fdd309">Cy_SysClk_PiloEnable</a> (void)</td></tr>
<tr class="memdesc:ga92e44b1390d7cabf2c597c45a5fdd309"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the PILO.  <a href="#ga92e44b1390d7cabf2c597c45a5fdd309">More...</a><br /></td></tr>
<tr class="separator:ga92e44b1390d7cabf2c597c45a5fdd309"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad1f5cd3318276616c1e0553f868142d2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#gad1f5cd3318276616c1e0553f868142d2">Cy_SysClk_PiloIsEnabled</a> (void)</td></tr>
<tr class="memdesc:gad1f5cd3318276616c1e0553f868142d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reports the Enabled/Disabled status of the PILO.  <a href="#gad1f5cd3318276616c1e0553f868142d2">More...</a><br /></td></tr>
<tr class="separator:gad1f5cd3318276616c1e0553f868142d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf73c2da9e8676f8b4cdfcd1f95e839f9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#gaf73c2da9e8676f8b4cdfcd1f95e839f9">Cy_SysClk_PiloDisable</a> (void)</td></tr>
<tr class="memdesc:gaf73c2da9e8676f8b4cdfcd1f95e839f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the PILO.  <a href="#gaf73c2da9e8676f8b4cdfcd1f95e839f9">More...</a><br /></td></tr>
<tr class="separator:gaf73c2da9e8676f8b4cdfcd1f95e839f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad609f2077dfc69a271fb94cba111ad42"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#gad609f2077dfc69a271fb94cba111ad42">Cy_SysClk_PiloSetTrim</a> (uint32_t trimVal)</td></tr>
<tr class="memdesc:gad609f2077dfc69a271fb94cba111ad42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the PILO trim bits, which adjusts the PILO frequency.  <a href="#gad609f2077dfc69a271fb94cba111ad42">More...</a><br /></td></tr>
<tr class="separator:gad609f2077dfc69a271fb94cba111ad42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga608ccc641bfd0b816ef8dc9d58c6f738"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#ga608ccc641bfd0b816ef8dc9d58c6f738">Cy_SysClk_PiloGetTrim</a> (void)</td></tr>
<tr class="memdesc:ga608ccc641bfd0b816ef8dc9d58c6f738"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reports the current PILO trim bits value.  <a href="#ga608ccc641bfd0b816ef8dc9d58c6f738">More...</a><br /></td></tr>
<tr class="separator:ga608ccc641bfd0b816ef8dc9d58c6f738"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6c21afebcb9f09b55c9589a682130e78"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#ga6c21afebcb9f09b55c9589a682130e78">Cy_SysClk_PiloBackupEnable</a> (void)</td></tr>
<tr class="memdesc:ga6c21afebcb9f09b55c9589a682130e78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the PILO as always on if Backup Domain is present.  <a href="#ga6c21afebcb9f09b55c9589a682130e78">More...</a><br /></td></tr>
<tr class="separator:ga6c21afebcb9f09b55c9589a682130e78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga971789bdb0713f551f314eb405c6e2a1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#ga971789bdb0713f551f314eb405c6e2a1">Cy_SysClk_PiloBackupDisable</a> (void)</td></tr>
<tr class="memdesc:ga971789bdb0713f551f314eb405c6e2a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the PILO as always on if Backup Domain is present.  <a href="#ga971789bdb0713f551f314eb405c6e2a1">More...</a><br /></td></tr>
<tr class="separator:ga971789bdb0713f551f314eb405c6e2a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3a27da8dadb92695750b12f41c91be06"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#ga3a27da8dadb92695750b12f41c91be06">Cy_SysClk_PiloOkay</a> (void)</td></tr>
<tr class="memdesc:ga3a27da8dadb92695750b12f41c91be06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reports the status of the PILO.  <a href="#ga3a27da8dadb92695750b12f41c91be06">More...</a><br /></td></tr>
<tr class="separator:ga3a27da8dadb92695750b12f41c91be06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9c3147eb364c04d6820a9089cf390044"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#ga9c3147eb364c04d6820a9089cf390044">Cy_SysClk_PiloTcscEnable</a> (void)</td></tr>
<tr class="memdesc:ga9c3147eb364c04d6820a9089cf390044"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the PILO TCSC(Second order temperature curvature correction) Feature.  <a href="#ga9c3147eb364c04d6820a9089cf390044">More...</a><br /></td></tr>
<tr class="separator:ga9c3147eb364c04d6820a9089cf390044"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabf56d2b85a12e5e1dadc838619de6f08"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__sysclk__pilo__funcs.html#gabf56d2b85a12e5e1dadc838619de6f08">Cy_SysClk_PiloTcscDisable</a> (void)</td></tr>
<tr class="memdesc:gabf56d2b85a12e5e1dadc838619de6f08"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the PILO TCSC(Second order temperature curvature correction) Feature.  <a href="#gabf56d2b85a12e5e1dadc838619de6f08">More...</a><br /></td></tr>
<tr class="separator:gabf56d2b85a12e5e1dadc838619de6f08"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga92e44b1390d7cabf2c597c45a5fdd309"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga92e44b1390d7cabf2c597c45a5fdd309">&#9670;&nbsp;</a></span>Cy_SysClk_PiloEnable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloEnable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the PILO. </p>
<dl class="section note"><dt>Note</dt><dd>This function blocks for 1 millisecond between enabling the PILO and releasing the PILO reset.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: PILO needs to source the LFCLK.  All peripherals clocked by</span></div><div class="line"><span class="comment">                 the LFCLK are disabled and the Watchdog timer (WDT) is unlocked. */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Enable the PILO. Note: Blocks for 1 millisecond. */</span></div><div class="line">    <a class="code" href="group__group__sysclk__pilo__funcs.html#ga92e44b1390d7cabf2c597c45a5fdd309">Cy_SysClk_PiloEnable</a>();</div><div class="line"></div><div class="line">    <span class="comment">/* Set the LFCLK source to the PILO */</span></div><div class="line">    <a class="code" href="group__group__sysclk__clk__lf__funcs.html#ga446424e5edb0121a1c6c06e7d87cd054">Cy_SysClk_ClkLfSetSource</a>(<a class="code" href="group__group__sysclk__clk__lf__enums.html#gga8bfd6f85870f0d30d15e73b3ed820db6a51a3252aefb2b8198451b0d1589e47bf">CY_SYSCLK_CLKLF_IN_PILO</a>);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gad1f5cd3318276616c1e0553f868142d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad1f5cd3318276616c1e0553f868142d2">&#9670;&nbsp;</a></span>Cy_SysClk_PiloIsEnabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Cy_SysClk_PiloIsEnabled </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reports the Enabled/Disabled status of the PILO. </p>
<dl class="section return"><dt>Returns</dt><dd>Boolean status of PILO: true - Enabled, false - Disabled.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: LFCLK needs to be sourced by the ILO instead of the PILO. All</span></div><div class="line"><span class="comment">                 peripherals clocked by the LFCLK are disabled and the Watchdog</span></div><div class="line"><span class="comment">                 timer (WDT) is unlocked. */</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__sysclk__pilo__funcs.html#gad1f5cd3318276616c1e0553f868142d2">Cy_SysClk_PiloIsEnabled</a>())</div><div class="line">    {</div><div class="line">        <span class="comment">/* Disable the PILO */</span></div><div class="line">        <a class="code" href="group__group__sysclk__pilo__funcs.html#gaf73c2da9e8676f8b4cdfcd1f95e839f9">Cy_SysClk_PiloDisable</a>();</div><div class="line"></div><div class="line">        <span class="comment">/* Enable the ILO */</span></div><div class="line"><span class="preprocessor">#if (defined (CY_IP_MXS40SRSS) &amp;&amp; (CY_IP_MXS40SRSS_VERSION &lt; 2))</span></div><div class="line">        <a class="code" href="group__group__sysclk__ilo__funcs.html#gad07e09e072e4cd87baa319711d0549b5">Cy_SysClk_IloEnable</a>();</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line">        <span class="comment">/* Set the LFCLK source to the ILO */</span></div><div class="line">        <a class="code" href="group__group__sysclk__clk__lf__funcs.html#ga446424e5edb0121a1c6c06e7d87cd054">Cy_SysClk_ClkLfSetSource</a>(<a class="code" href="group__group__sysclk__clk__lf__enums.html#gga8bfd6f85870f0d30d15e73b3ed820db6a724311d4501aedcbd0699a3302aabaf9">CY_SYSCLK_CLKLF_IN_ILO</a>);</div><div class="line">    }</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaf73c2da9e8676f8b4cdfcd1f95e839f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf73c2da9e8676f8b4cdfcd1f95e839f9">&#9670;&nbsp;</a></span>Cy_SysClk_PiloDisable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloDisable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the PILO. </p>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: LFCLK needs to be sourced by the ILO instead of the PILO. All</span></div><div class="line"><span class="comment">                 peripherals clocked by the LFCLK are disabled and the Watchdog</span></div><div class="line"><span class="comment">                 timer (WDT) is unlocked. */</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__sysclk__pilo__funcs.html#gad1f5cd3318276616c1e0553f868142d2">Cy_SysClk_PiloIsEnabled</a>())</div><div class="line">    {</div><div class="line">        <span class="comment">/* Disable the PILO */</span></div><div class="line">        <a class="code" href="group__group__sysclk__pilo__funcs.html#gaf73c2da9e8676f8b4cdfcd1f95e839f9">Cy_SysClk_PiloDisable</a>();</div><div class="line"></div><div class="line">        <span class="comment">/* Enable the ILO */</span></div><div class="line"><span class="preprocessor">#if (defined (CY_IP_MXS40SRSS) &amp;&amp; (CY_IP_MXS40SRSS_VERSION &lt; 2))</span></div><div class="line">        <a class="code" href="group__group__sysclk__ilo__funcs.html#gad07e09e072e4cd87baa319711d0549b5">Cy_SysClk_IloEnable</a>();</div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line">        <span class="comment">/* Set the LFCLK source to the ILO */</span></div><div class="line">        <a class="code" href="group__group__sysclk__clk__lf__funcs.html#ga446424e5edb0121a1c6c06e7d87cd054">Cy_SysClk_ClkLfSetSource</a>(<a class="code" href="group__group__sysclk__clk__lf__enums.html#gga8bfd6f85870f0d30d15e73b3ed820db6a724311d4501aedcbd0699a3302aabaf9">CY_SYSCLK_CLKLF_IN_ILO</a>);</div><div class="line">    }</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gad609f2077dfc69a271fb94cba111ad42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad609f2077dfc69a271fb94cba111ad42">&#9670;&nbsp;</a></span>Cy_SysClk_PiloSetTrim()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloSetTrim </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>trimVal</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the PILO trim bits, which adjusts the PILO frequency. </p>
<p>This is typically done after measuring the PILO frequency; see <a class="el" href="group__group__sysclk__calclk__funcs.html#ga0a87e123411d5711344780ddfa492f37">Cy_SysClk_StartClkMeasurementCounters()</a>.</p>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: PILO needs to be trimmed to +/- 2% of nominal 32.768 kHz using</span></div><div class="line"><span class="comment">                 the ECO as the source. */</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define ECO_FREQ        24000000UL  </span><span class="comment">/* 24 MHz ECO */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define PILO_NOMINAL    32768UL     </span><span class="comment">/* 32.768 kHz PILO */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define PILO_ACCURACY   655UL       </span><span class="comment">/* PILO_NOMINAL * 0.02 */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line">    <span class="keywordtype">bool</span> trimStatus = <span class="keyword">false</span>;</div><div class="line"></div><div class="line">    <span class="keywordflow">while</span>(!trimStatus)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Start the PILO clock measurement using the ECO */</span></div><div class="line">        (void)<a class="code" href="group__group__sysclk__calclk__funcs.html#ga0a87e123411d5711344780ddfa492f37">Cy_SysClk_StartClkMeasurementCounters</a>(CY_SYSCLK_MEAS_CLK_PILO,    <span class="comment">/* Counter 1 clock      = PILO */</span></div><div class="line">                                                    0x3FFUL,                    <span class="comment">/* Counter 1 init value = 1024 */</span></div><div class="line">                                                    CY_SYSCLK_MEAS_CLK_ECO);    <span class="comment">/* Counter 2 clock      = ECO  */</span></div><div class="line">        <span class="comment">/* Wait for counter 1 to reach 0 */</span></div><div class="line">        <span class="keywordflow">while</span> (!<a class="code" href="group__group__sysclk__calclk__funcs.html#gaab1d99baa3555bcbbde18bc24822d4b0">Cy_SysClk_ClkMeasurementCountersDone</a>()){}</div><div class="line"></div><div class="line">        <span class="comment">/* Measure clock 1 with the ECO clock cycles (counter 2) */</span></div><div class="line">        uint32_t measuredFreq = <a class="code" href="group__group__sysclk__calclk__funcs.html#ga979f2ef437908618291bf3a935488412">Cy_SysClk_ClkMeasurementCountersGetFreq</a>(<span class="keyword">false</span>, ECO_FREQ);</div><div class="line"></div><div class="line">        <span class="comment">/* Increment/decrement the trim depending on the returned result */</span></div><div class="line">        <span class="keywordflow">if</span> ((PILO_NOMINAL + PILO_ACCURACY) &lt; measuredFreq)</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__sysclk__pilo__funcs.html#gad609f2077dfc69a271fb94cba111ad42">Cy_SysClk_PiloSetTrim</a>(<a class="code" href="group__group__sysclk__pilo__funcs.html#ga608ccc641bfd0b816ef8dc9d58c6f738">Cy_SysClk_PiloGetTrim</a>() - 1UL);</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (measuredFreq &lt; (PILO_NOMINAL - PILO_ACCURACY))</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__sysclk__pilo__funcs.html#gad609f2077dfc69a271fb94cba111ad42">Cy_SysClk_PiloSetTrim</a>(<a class="code" href="group__group__sysclk__pilo__funcs.html#ga608ccc641bfd0b816ef8dc9d58c6f738">Cy_SysClk_PiloGetTrim</a>() + 1UL);</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">        {</div><div class="line">            <span class="comment">/* Trimmed within limits */</span></div><div class="line">            trimStatus = <span class="keyword">true</span>;</div><div class="line">        }</div><div class="line">    }</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga608ccc641bfd0b816ef8dc9d58c6f738"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga608ccc641bfd0b816ef8dc9d58c6f738">&#9670;&nbsp;</a></span>Cy_SysClk_PiloGetTrim()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_SysClk_PiloGetTrim </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reports the current PILO trim bits value. </p>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: PILO needs to be trimmed to +/- 2% of nominal 32.768 kHz using</span></div><div class="line"><span class="comment">                 the ECO as the source. */</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define ECO_FREQ        24000000UL  </span><span class="comment">/* 24 MHz ECO */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define PILO_NOMINAL    32768UL     </span><span class="comment">/* 32.768 kHz PILO */</span><span class="preprocessor"></span></div><div class="line"><span class="preprocessor">    #define PILO_ACCURACY   655UL       </span><span class="comment">/* PILO_NOMINAL * 0.02 */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line">    <span class="keywordtype">bool</span> trimStatus = <span class="keyword">false</span>;</div><div class="line"></div><div class="line">    <span class="keywordflow">while</span>(!trimStatus)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Start the PILO clock measurement using the ECO */</span></div><div class="line">        (void)<a class="code" href="group__group__sysclk__calclk__funcs.html#ga0a87e123411d5711344780ddfa492f37">Cy_SysClk_StartClkMeasurementCounters</a>(CY_SYSCLK_MEAS_CLK_PILO,    <span class="comment">/* Counter 1 clock      = PILO */</span></div><div class="line">                                                    0x3FFUL,                    <span class="comment">/* Counter 1 init value = 1024 */</span></div><div class="line">                                                    CY_SYSCLK_MEAS_CLK_ECO);    <span class="comment">/* Counter 2 clock      = ECO  */</span></div><div class="line">        <span class="comment">/* Wait for counter 1 to reach 0 */</span></div><div class="line">        <span class="keywordflow">while</span> (!<a class="code" href="group__group__sysclk__calclk__funcs.html#gaab1d99baa3555bcbbde18bc24822d4b0">Cy_SysClk_ClkMeasurementCountersDone</a>()){}</div><div class="line"></div><div class="line">        <span class="comment">/* Measure clock 1 with the ECO clock cycles (counter 2) */</span></div><div class="line">        uint32_t measuredFreq = <a class="code" href="group__group__sysclk__calclk__funcs.html#ga979f2ef437908618291bf3a935488412">Cy_SysClk_ClkMeasurementCountersGetFreq</a>(<span class="keyword">false</span>, ECO_FREQ);</div><div class="line"></div><div class="line">        <span class="comment">/* Increment/decrement the trim depending on the returned result */</span></div><div class="line">        <span class="keywordflow">if</span> ((PILO_NOMINAL + PILO_ACCURACY) &lt; measuredFreq)</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__sysclk__pilo__funcs.html#gad609f2077dfc69a271fb94cba111ad42">Cy_SysClk_PiloSetTrim</a>(<a class="code" href="group__group__sysclk__pilo__funcs.html#ga608ccc641bfd0b816ef8dc9d58c6f738">Cy_SysClk_PiloGetTrim</a>() - 1UL);</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (measuredFreq &lt; (PILO_NOMINAL - PILO_ACCURACY))</div><div class="line">        {</div><div class="line">            <a class="code" href="group__group__sysclk__pilo__funcs.html#gad609f2077dfc69a271fb94cba111ad42">Cy_SysClk_PiloSetTrim</a>(<a class="code" href="group__group__sysclk__pilo__funcs.html#ga608ccc641bfd0b816ef8dc9d58c6f738">Cy_SysClk_PiloGetTrim</a>() + 1UL);</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">        {</div><div class="line">            <span class="comment">/* Trimmed within limits */</span></div><div class="line">            trimStatus = <span class="keyword">true</span>;</div><div class="line">        }</div><div class="line">    }</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga6c21afebcb9f09b55c9589a682130e78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6c21afebcb9f09b55c9589a682130e78">&#9670;&nbsp;</a></span>Cy_SysClk_PiloBackupEnable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloBackupEnable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the PILO as always on if Backup Domain is present. </p>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B &amp; CAT1D devices. </dd></dl>

</div>
</div>
<a id="ga971789bdb0713f551f314eb405c6e2a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga971789bdb0713f551f314eb405c6e2a1">&#9670;&nbsp;</a></span>Cy_SysClk_PiloBackupDisable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloBackupDisable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the PILO as always on if Backup Domain is present. </p>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B &amp; CAT1D devices. </dd></dl>

</div>
</div>
<a id="ga3a27da8dadb92695750b12f41c91be06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3a27da8dadb92695750b12f41c91be06">&#9670;&nbsp;</a></span>Cy_SysClk_PiloOkay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Cy_SysClk_PiloOkay </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reports the status of the PILO. </p>
<dl class="section return"><dt>Returns</dt><dd>true = okay <br />
false = not okay</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B(20829) devices. </dd></dl>

</div>
</div>
<a id="ga9c3147eb364c04d6820a9089cf390044"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9c3147eb364c04d6820a9089cf390044">&#9670;&nbsp;</a></span>Cy_SysClk_PiloTcscEnable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloTcscEnable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the PILO TCSC(Second order temperature curvature correction) Feature. </p>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B devices. </dd></dl>

</div>
</div>
<a id="gabf56d2b85a12e5e1dadc838619de6f08"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabf56d2b85a12e5e1dadc838619de6f08">&#9670;&nbsp;</a></span>Cy_SysClk_PiloTcscDisable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_SysClk_PiloTcscDisable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the PILO TCSC(Second order temperature curvature correction) Feature. </p>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B devices. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
